home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / ansi / smileq20.zip / MUSIC.TXT < prev    next >
Text File  |  1992-06-12  |  7KB  |  186 lines

  1.  
  2.   S M I L E   S U P P O R T E D   M U S I C \ S O U N D    C O D E S
  3.  
  4.  
  5. Music and Sound Codes follow the format of the BASIC language commands
  6. PLAY and SOUND.  The major difference is a "Trigger Sequence" is needed
  7. to turn on the Music Routine in SMILE that emulates those BASIC 
  8. commands.  Many BBS programs and ANSI viewers also support this type of 
  9. music format.  It just so happens that the Music "Trigger Sequence" in
  10. these programs is ESC[ which is identical to the "Trigger Sequence" 
  11. used to begin an ANSI Escape sequence.  So, this Music Code format has
  12. "generally" become known as ANSI MUSIC.   For convience this document 
  13. will use that name to describe SMILE supported Music and Sound commands.
  14.  
  15.  
  16. ANSI MUSIC is actually made up of a three part string, or sequence of 
  17. characters.
  18.  
  19.   (1)        (2)             (3)
  20.   Trigger    Music\Sound     Terminate
  21.  
  22.   ESC[       <commands>      CTRL-N
  23.  
  24.  
  25.   (1) The trigger sequence is ESCape (Dec 27) + [ (Dec 91)  followed by
  26.       either MF (Music Foreground) or MB (Music Background).
  27.  
  28.   (2) A string of music commands (see below).  Blank spaces are ignored.
  29.  
  30.   (3) The terminate character is CTRN-N (Dec 14)
  31.  
  32. The MUSIC\SOUND routine in SMILE is triggered by ESC[MF or ESC[MB and 
  33. begins to interpret the following charactes as MUSIC or SOUND until the 
  34. terminate character CTRL-N is read.
  35.  
  36.  
  37.  
  38. MUSIC COMMANDS
  39.  
  40.           Please refer to your BASIC manual for information on the
  41.           BASIC Play commands.  The following are all valid for
  42.           beginning a Music string in SMILE: MF, MB, MN, ML, MS.
  43.           Although MB (Music Background) is valid, true backgroud    
  44.           music is NOT supported at this time.
  45.      
  46.           Syntax: MF T120 O2 C8D8E8F8G4
  47.  
  48.  
  49.  
  50.           MF  Music Foreground 
  51.           MB  Music Background  (not supported, defaults to MF)
  52.  
  53.  
  54.           MS  Music Staccato    notes play 3\4 of designated Length
  55.           MN  Music Normal      notes play 7\8 of designated Length
  56.           ML  Music Legato      notes play full designated Length
  57.   
  58.           A,B,C,D,E,F,G    Play the specified note in current octive
  59.           Following a note:
  60.             1-64     Set note length (Ex. A8 = play note A as 1\8 note)
  61.             # or +   indicates Sharpened note.
  62.             -        indicates Flattened note.   
  63.             .        increases not length by 1\2.
  64.  
  65.           On  Octive Range (n = 0-6)    ** Default is 4
  66.               Select from seven available octives
  67.  
  68.           >   Raise Octive one step
  69.           <   Lower Octive one step
  70.  
  71.           Nn  Note Value   (n = 0-84)   ** Default is 4 - Quarter Note
  72.               There are 84 possible notes in seven octives.
  73.  
  74.           Ln  Note Length  (n = 1-64) Sets following notes to the value
  75.               of "n" until value is changed.
  76.               1 = Whole Note, 2 = Half Note, 4 = Quarter Note  etc
  77.  
  78.           Tn  Tempo        (n = 32-255) ** Default is 120
  79.               Number of Quarter notes per minute
  80.  
  81.     Example:  Add the Trigger Sequence and Terminate character to the 
  82.               following Music string to PLAY Happy Birthday.
  83.  
  84.  
  85.     MFT120MNO3C6C8D4C4F4E2C6C8D4C4G4F2C6C8O4C4O3A4F4E4D2B-6B-8A4F4G4F2
  86.  
  87.  
  88.  
  89.  
  90. SOUND COMMANDS
  91.  
  92.  
  93.           ( Thanks to Julie Ibarra, author of ANSIPLAY for this idea )
  94.  
  95.           Sound commands are not yet supported by any BBS software I am
  96.           aware of.
  97.      
  98.           Syntax: 
  99.           Freq;Duration;Cycle1;Delay1;Variation; Cycle2; Delay2
  100.      
  101.           Custom Sounds are supported in SMILET by using a SOUND CODE
  102.           similar to that found in BASIC and the program ANSIPLAY.
  103.           A second Cycle\Delay option was added to the SOUND code
  104.           used in ANSIPLAY, providing a looping effect.  The frequency
  105.           values used to produce the musical notes are listed somewhere
  106.           down the page.
  107.      
  108.           The SOUND statement must begin and end in the same manner
  109.           discussed above for a normal music string.  
  110.  
  111.           The SOUND CODE consists of the following parameters serparated 
  112.           by a semicolons (;) :
  113.      
  114.           FREQ     : Frequency of note to be played.  The effective 
  115.                      range of frequencies is 37 to 7904.  
  116.                      (0..65535)
  117.           
  118.           DURATION : Time, in CLOCK TICKS, the note should be played.
  119.                      (18.2 ticks per second)
  120.                      (0..65535)
  121.              
  122.           CYCLE1   : Number of times to repeat Frequency\Duration.
  123.                      (0..65535)
  124.              
  125.           DELAY1   : Delay Time between CYCLES (Milliseconds / 4).  
  126.                      (0..65535)
  127.              
  128.           VARIATION: Frequency value is changed by this number for
  129.                      each CYCLE the note is played.  A negative number
  130.                      will be subtracted, but if FREQ reaches 0 then 
  131.                      VARIATION is added to FREQ for the remainder of the
  132.                      cycles.
  133.                      (-65535..65535)
  134.  
  135.           CYCLE2    : Number of times to repeat the first 5 parameters
  136.                       <Freq;Duration;cycles;delay;variation>
  137.                       (0..65535)
  138.  
  139.           DELAY2    : Delay Time between CYCLE2 (Milliseconds /4).
  140.                       (0..65535)
  141.      
  142.           (NOTE: 1 second = 1000 milliseconds)
  143.              
  144.      
  145.  
  146.              
  147.      
  148.           SOUND CODE Frequency Values (84 Notes - 7 Octives):
  149.      
  150.  
  151.             C    C#   D    D#   E    F    F#   G    G#   A    A#   B
  152.        
  153.             65   69   73   78   82   87   92   98  104  110  116  123 
  154.            131  139  147  156  165  175  185  196  208  220  233  247 
  155.            262  278  294  312  330  350  370  392  416  440  466  494 
  156.            524  556  588  624  660  700  740  784  832  880  932  988 
  157.           1048 1112 1176 1248 1320 1400 1480 1568 1664 1760 1864 1976 
  158.           2096 2224 2352 2496 2640 2800 2960 3136 3328 3520 3728 3952 
  159.           4192 4448 4704 4992 5280 5600 5920 6272 6656 7040 7456 7904  
  160.  
  161.  
  162.           EXAMPLE: (Telephone jingle)
  163.                    ESC[MF 800;1;2;50;-200;10;50 CTRL-N
  164.  
  165.                 ESC[MF  Trigger sequencd
  166.           Freq:    800  Note Frequency 
  167.           Dura:      1  Play Note for 1 Clock Tick (18.2 ticks per second)
  168.           Cyc1:      2  Repeat Frequency\Duration 2 times
  169.           Dly1:     50  Delay 10/4 milliseconds before repeating 
  170.           Vari:   -200  Decrease Note value by 200 each cycle 
  171.           Cyc2:     10  Repeat first 5 parameters 10 times
  172.           Dly2:     50  Delay 10/4 milliseconds before repeating
  173.                 CTRL-N  Terminate Character
  174.           
  175.  
  176.           One advantage of the SOUND CODE is the ability to place a
  177.           PAUSE in your ANSI screens without having to use a
  178.           multitude of ESC[s codes.  Just use a SOUND CODE with the
  179.           DELAY set very high to get a pause.  For example,
  180.      
  181.           ESC[MF ;;;60000
  182.      
  183.           would pause your ANSI Screen for 15 seconds (60000/4), or 
  184.           until a key is pressed when viewing it with SMILE.  Remember,
  185.           these SOUND CODES are not supported by bulletin boards...(yet)!
  186.